#include "widget.h"
#include <QImage>
#include <QPixmap>
#include <QLabel>
Widget::Widget(QWidget *parent)
    : QDialog(parent)
{
    label0 = new cQLabel(this);
    label0->move(100,150);
    label0->resize(50,50);
    /*
    QImage *image0 = new QImage(1,1,QImage::Format_RGB888);
    image0->setPixel(0,0,qRgb(0,255,0));
    QLabel *label0 = new QLabel(this);
    label0->resize(50,50);
    label0->move(0,0);

    label0->setPixmap(QPixmap::fromImage(image0->scaled(50,50)));
    */
    //label0->setText("Hello");

    for (int i=1;i<=10;++i)
    qDebug()<<qrand();
    wFile = new QFile("c://pack//123.txt");
    wFile->open(QFile::WriteOnly);
    char chstart = 0xfe,chend=0xef,chzero=0x00,chmax=79,chout =0;
    for (int ii=0;ii<=5;ii++)
    {
        wFile->write(&chstart,1);
        wFile->write(&chend,1);
        for (int i=0;i<=120-1;i++)
        {
           // for (int j=0;j<10;j++)
            //{
//
            chout = (unsigned char)i;
                    //chout =qrand()%161;
                    wFile->write(&chout,1);

  //          }
        }
        char convert[10] = {0,1,2,3,4,5,6,7,8,9};
        wFile->write(convert+1,1);
        wFile->write(convert+2,1);
        for (int i=0;i<40;i++)
            wFile->write(&chzero,1);
        //for (int i=0;i<60;i++)
          //  wFile->write(&chmax,1);

    }
    wFile->close();

}

Widget::~Widget()
{

}
